package com.example.design.ddd.practice2.domain.Payment.valueobject;

import com.example.design.ddd.practice2.domain.Payment.PaymentMethod;
import com.example.design.ddd.practice2.domain.order.valueobject.Money;

import java.util.HashMap;
import java.util.Map;

public class PaymentRequest {
    private String orderId;
    private Money amount;
    private PaymentMethod paymentMethod;
    private Map<String, String> extraParams;

    public PaymentRequest(String orderId, 
                         Money amount, 
                         PaymentMethod method) {
        this.orderId = orderId;
        this.amount = amount;
        this.paymentMethod = method;
        this.extraParams = new HashMap<>();
    }

    // 添加支付扩展参数（如微信的openId）
    public void addParam(String key, String value) {
        extraParams.put(key, value);
    }

    public String getParam(String key) {
        return extraParams.get(key);
    }

    public Money getAmount() {
        return amount;
    }
}